package de.hs.rm.UJAdapter.impl;

import javax.management.NotificationListener;

import org.osgi.service.upnp.UPnPAction;
import org.osgi.service.upnp.UPnPDevice;
import org.osgi.service.upnp.UPnPService;
import org.osgi.service.upnp.UPnPStateVariable;

public class UJService implements UPnPService {

	private String id = null;
	private String type = null;
	private String version = null;
	private UPnPAction[] actions = null;
	private UPnPStateVariable[] stateVariables = null;
	private UPnPDevice device = null;
	private NotificationListener notificationListener = null;
	
		
	@Override
	public String getId() {
		return id;
	}
	
	@Override
	public String getType() {
		return type;
	}

	@Override
	public String getVersion() {
		return version;
	}

	@Override
	public UPnPAction getAction(String name) {
		for (int i=0; i<actions.length; i++)
			if (actions[i].getName().equals(name))
		        return actions[i];
		return null;
	}

	@Override
	public UPnPAction[] getActions() {
		return actions;
	}

	@Override
	public UPnPStateVariable[] getStateVariables() {
		return stateVariables;
	}

	@Override
	public UPnPStateVariable getStateVariable(String name) {
		for (int i=0; i<stateVariables.length; i++)
			if (stateVariables[i].getName().equals(name))
		        return stateVariables[i];
		return null;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public void setType(String type) {
		this.type = type;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public void setActions(UPnPAction[] actions) {
		this.actions = actions;
	}

	public void setStateVariables(UPnPStateVariable[] stateVariables) {
		this.stateVariables = stateVariables;
	}

	public UPnPDevice getDevice() {
		return device;
	}

	public void setDevice(UPnPDevice device) {
		this.device = device;
	}

	public NotificationListener getNotificationListener() {
		return notificationListener;
	}

	public void setNotificationListener(NotificationListener notificationListener) {
		this.notificationListener = notificationListener;
	}

}
